<?php 
include_once '../Algos/Wall/deperditionWalls.php';
include_once '../Objects/Wall.php';
include_once '../Objects/House.php';

 
 try
  {
    $Mysql = new DBAccess('153.109.141.81:3306', 'savenrj', 'root', '');
    
    
    
    $walls = array();
    
    //$walls[0] = new Wall('M1', 'airExterieur', 10, 2.40, '');
    //$walls[1] = new Wall('M2', 'airExterieur', 8, 2.40, '');
     $walls[0] = new Wall('M2', 'airExterieur', 50, '', '');
    //$walls[2] = new Wall('M3', 'airExterieur', 30, 5, '');
    //$walls[3] = new Wall('M4', 'airExterieur', 30, 5, '');
    
   
    
    
    $house;
    //$house = new House(4, 1, 1, 'carre', 'Sion', 20, 2, 1970, $walls, false, false);
     $house = new House(4, 1, 1, 'square', 'Sion', 20, 2, 1970, 150 , 30, $walls, false , false);
    //$house  = new House('carre', 'Sion', 20, 2, 1970, $walls);
    
    
    $algo;
    $algo = new AlgoMur();
//   
//     //Test valeur U murs
//    echo 'Valeur U mur :';
//    echo $algo->getValeurU_Mur($walls[0], 1970);
//    
//    //Test Coeficient mur
//    echo '<br></br>Coeficient murs';
//    echo $algo->getCoefAE($walls[0], 1970);
    
//    //Test surface totale murs
//    $surface = 0;
//    echo ' <br></br>Surface totale murs : ';
//    $surface +=  $algo->getSurfaceAE(new Wall('M1', 'airExterieur', 10, 2.40, ''));
//    $surface +=  $algo->getSurfaceAE(new Wall('M1', 'airExterieur', 8, 2.40, ''));
//    echo $surface - $algo->totalSurfaceWindows;
    
    
    echo '<br></br>Déperdition totale';
    echo $algo->getTotalDeperdition($house, $walls);
    
   //echo AlgoMur::getValeurU_Mur($wall, '1970');
    
//    $couches = array(
//     array(5 , "béton armé"),
//    array(5 , "béton armé"));
    
    
    //echo AlgoMur::getRtherm($couches);
    //echo DBAccess::getRthermMat('chape');
    
    
 
  }
  catch (MySQLExeption $e) 
  {
    echo $e -> RetourneErreur();
  }
  
?>
